package club.jdiy.core.sql;

import lombok.Getter;

import java.io.Serializable;

@Getter
public class CommentInfo implements Serializable {
    protected String name;
    protected String comment;

    public CommentInfo(String name, String comment) {
        this.name = name;
        this.comment = comment;
    }

    @SuppressWarnings("unused")
    public String getSimpleComment_() {
        if (comment == null) return null;
        String s = comment.trim();
        if (s.contains("(")) s = s.substring(0, s.indexOf("("));
        if (s.contains("（")) s = s.substring(0, s.indexOf("（"));
        if (s.length() > 18) s = s.substring(0, 18) + "..";
        return s;
    }
}
